<?php
Route::group(['prefix' => 'admin', 'namespace' => 'App\Http\Controllers\Admin'], function () {
    Route::get('/', 'WelcomeController@index');
    Route::get('register', 'WelcomeController@register');
    Route::get('forgot', 'WelcomeController@forgot');
    Route::get('logout', 'WelcomeController@logout');

    Route::get('profile', 'ProfileController@getIndex');
    Route::get('profile/changepwd', 'ProfileController@getChangepwd');

    Route::get('siteconfig/meta', 'SiteconfigController@getMeta');
    Route::post('siteconfig/set-meta', 'SiteconfigController@postSetMeta');
    Route::get('siteconfig/logo', 'SiteconfigController@getLogo');
    Route::post('siteconfig/upload-logo', 'SiteconfigController@postUploadLogo');
});

Route::group(['prefix' => 'api', 'namespace' => 'App\Http\Controllers\Api'], function () {
    Route::post('account/login', 'AccountController@postLogin');
    Route::post('account/register', 'AccountController@postRegister');
    Route::post('account/send-sms-code', 'AccountController@sendSmsCode');
    Route::post('account/send-mail-code', 'AccountController@sendMailCode');
    Route::post('account/check-username-unique', 'AccountController@checkUsernameUnique');
    Route::post('account/check-mobile-unique', 'AccountController@checkMobileUnique');
    Route::post('account/check-email-unique', 'AccountController@checkEmailUnique');
    Route::post('account/forget', 'AccountController@postForget');
    Route::post('account/findpwd', 'AccountController@postFindpwd');
    Route::post('account/logout', 'AccountController@postLogout');

    Route::post('user/set-profile', 'UserController@postSetProfile');
    Route::post('user/changepwd', 'UserController@postChangepwd');
    Route::post('user/upload-avatar/{id}', 'UserController@postUploadAvatar');
});
